{% extends "base.html" %}


{% block title %}
<title>晋哆咕-搜索结果</title>
{% endblock %}


{% block css %}
<style>
    .img_items {
        position: relative;
        margin-top: 30px;
    }
    .img_items img {
        width: 200px;
        height: 300px;
    }
    .img_items a {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        width: 100%;
        text-align: center;
        padding: 5px 0;
    }
</style>
{% endblock %}


{% block body %}
{% if query %}
        <h3 style="color:red">搜索结果如下：</h3>
        {% for result in page.object_list %}
            <div class="col-md-2 col-md-offset-1 img_items">
                <img src="/media/{{ result.object.img }}" alt="">
                <a href="/detail/{{ result.object.id }}">{{ result.object.title }}</a><br/>
            </div>
        {% empty %}
            <p>啥也没找到</p>
        {% endfor %}
    {% endif %}
{% endblock %}
